<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option"/>
  </el-card>
</template>

<script>

import ColumnType from '@/framework/constant/ColumnType'
import GenderEnum from '@/feature/live/infra/constants/GenderEnum'
import { roomApi } from '@/feature/live/infra/api/roomApi'
import CURDTable from '@/framework/components/table/CURDTable'
import RoomStatusEnum from '@/feature/live/infra/constants/RoomStatusEnum'
import LiveRoomSortByEnum from '@/feature/live/infra/constants/LiveRoomSortByEnum'

export default {
  components: { CURDTable },
  data() {
    return {
      option: {
        requestApi: roomApi,
        showSelection: false,
        columns: [
          // {
          //   label: '直播间主播openid',
          //   prop: 'authorOpenid'
          // },
          {
            label: '标题',
            prop: 'authorName',
            searchable: true,
            searchProp: 'title',
            width: 280
          },
          {
            label: '头像',
            width: 100,
            prop: 'authorPic',
            type: ColumnType.IMAGE
          },
          {
            label: '状态',
            searchable: true,
            type: ColumnType.RADIO,
            hiddenInForm: true,
            width: 80,
            options: RoomStatusEnum,
            prop: 'status'
          },
          {
            label: '在线人数',
            prop: 'onlineNum',
            width: 100,
            type: ColumnType.NUMBER
          },
          {
            label: '销量',
            prop: 'sales',
            type: ColumnType.NUMBER
          },
          {
            label: '开播时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'createTime'
          },
          {
            label: '达人等级',
            prop: 'authorLevel',
            width: 80,
            type: ColumnType.NUMBER
          },
          {
            label: '商品类别',
            prop: 'productCategory',
            width: 200
          },
          {
            label: '场均gmv',
            prop: 'averageGmv'
          },
          {
            label: '粉丝数量',
            prop: 'fansNum',
            type: ColumnType.NUMBER
          },
          {
            label: '平均佣金率(百分比)',
            prop: 'averageCommissionRate'
          },
          // {
          //   label: '直播间id',
          //   prop: 'roomId',
          //   type: ColumnType.SELECT
          // },
          {
            label: '性别',
            prop: 'gender',
            type: ColumnType.RADIO,
            options: GenderEnum
          },
          // {
          //   label: '内部生成的加密字段。直播间转链请求的live_ext应填此字段',
          //   prop: 'ext'
          // },

          {
            label: '创建时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtCreate'
          },
          {
            label: '修改时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtModified'
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

